const fileService = require("../service/file.service")
const FileService=require("../service/file.service")

class FileController{
    async  create(ctx,next){
        // 获取对应的信息
        const {filename,mimetype,size} =ctx.request.file
        const {id}=ctx.user
        const result=await  fileService.createAvatar(filename,mimetype,size,id)
        // 返回结果
        ctx.body={
            code:0,
            message:'头像上传成功',
            data:result
        }
   }
}

module.exports=new FileController()